//
//  Common.swift
//  WLLWeibo
//
//  Created by 王乐乐 on 16/8/9.
//  Copyright © 2016年 itcast. All rights reserved.
//

import UIKit


typealias s  = String

// 切换根控制器通知名字
let WBSWITCHROOTVCNOTIFICATION = "WBSWITCHROOTVCNOTIFICATION"
/**
 自定义打印
 
 - parameter message:  内容
 - parameter file:     类名
 - parameter function: 方法名
 - parameter line:     行数
 */
func printLog<T>(message:T,file:String = __FILE__,function: String = #function, line: Int = __LINE__){
//    print(message,"\n",file,"\n",function,"\n",line,"\n")
        /// 获取末尾部分
    #if DEBUG
    let newFile = (file as NSString).lastPathComponent
    let result = "文件:\(newFile) 方法:\(function) [\(line)]  : \(message)"
    print(result)
    #endif
}


/**
 加密方法
 */
func addSecret(secret:String) -> String {
    
   return WLLCommonFunc.textFromBase64String(secret)
    
}
//微博账号

let WBName = "18242313211"
let WBPasswd = addSecret("MTIxNTIyNXdnZHdi")

 //微博相关信息
/*App Key：4286880379
App Secret：9fff103f4e91dcf171ffa92292d9d31a
*/
let WBAppKey = "4286880379"
let WBAppSecret = "9fff103f4e91dcf171ffa92292d9d31a"
let WBRedirect_uri = "http://www.baidu.com"

//http://www.baidu.com

let   KSCREEN = UIScreen.mainScreen().bounds
let KSCREENW = UIScreen.mainScreen().bounds.size.width
let KSCREENH = UIScreen.mainScreen().bounds.size.height

 /// 主体颜色
let ThemeColor = UIColor.orangeColor()
/**
 RGB 颜色
 */
func RGBColor(red: CGFloat, green: CGFloat, blue: CGFloat, alpha: CGFloat = 1) -> UIColor {
    return UIColor(red: red/255 , green: green/255 , blue: blue/255 , alpha: alpha )
}
/**
 随机色
 */
func RandomColor() -> UIColor {
    let r  = CGFloat(random()%255)
    let g = CGFloat(random()%255)
    let b = CGFloat(random()%255)
    return RGBColor(r , green: g, blue: b)
}

//自定义首页 cell 的一些颜色
let StatusCellColor = UIColor(red: 237.0/255 , green: 237.0/255 , blue: 237.0/255 , alpha: 1 )
let OriginalColor = UIColor.whiteColor()
let  BottomColor = UIColor(red: 237.0/255 , green: 237.0/255 , blue: 237.0/255 , alpha: 1 )
let  AdditionColor = UIColor(red: 237.0/255 , green: 237.0/255 , blue: 237.0/255 , alpha: 1 )
let PictureViewCellColor = UIColor.clearColor()
